//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { CodelabsTemplates, CodelabsTemplatesResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCodelabsTemplatesList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CodelabsTemplatesResponse>(`/uctoo/codelabs_templates/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCodelabsTemplates = async (id: string) => {
  return requestClient.get<CodelabsTemplates>(`/uctoo/codelabs_templates/${id}`);
};

export const adductooCodelabsTemplates = async (data: Partial<CodelabsTemplates>) => {
  return requestClient.post<CodelabsTemplates>('/uctoo/codelabs_templates/add', data);
};

export const edituctooCodelabsTemplates = async (data: Partial<CodelabsTemplates>) => {
  return requestClient.post<CodelabsTemplates>('/uctoo/codelabs_templates/edit', data);
};

export const deleteuctooCodelabsTemplates = async (id: string) => {
  return requestClient.post<any>('/uctoo/codelabs_templates/del', { id });
};
